import { defineConfig } from 'umi';

import defaultSettings from './defaultSettings';
import proxy from './proxy';
import routes from './routes';

const { REACT_APP_ENV } = process.env;

export default defineConfig({
    hash: true,
    antd: {},
    history: {
        type: 'hash',
    },
    dva: {
        hmr: true,
    },
    layout: {
        locale: true,
        siderWidth: 208,
        ...defaultSettings,
    },
    dynamicImport: {
        loading: '@ant-design/pro-layout/es/PageLoading',
    },
    targets: {
        ie: 11,
    },
    routes,
    theme: {
        'primary-color': defaultSettings.primaryColor,
    },
    esbuild: {},
    title: false,
    ignoreMomentLocale: true,
    proxy: proxy[REACT_APP_ENV || 'dev'],
    manifest: {
        basePath: '/',
    },
    base: '/',
    publicPath: '/adp/',
    outputPath: 'dist/adp',
    fastRefresh: {},
});
